<div class="layui-logo">
	<img src="assets/images/sungologo.png" />
	<cite>SungoHealth</cite>
</div>
<ul class="layui-nav layui-layout-left">
	<li class="layui-nav-item" lay-unselect>
		<a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
	</li>
	<li class="layui-nav-item" lay-unselect>
		<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
	</li>
</ul>
<ul class="layui-nav layui-layout-right">
	<!--<li class="layui-nav-item" lay-unselect>
        <a id="btnMessage" title="消息"><i class="layui-icon layui-icon-notice"></i></a>
    </li>-->
	<li class="layui-nav-item layui-hide-xs" lay-unselect>
		<a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
	</li>
	<li class="layui-nav-item" lay-unselect>
		<a>
			<img id="asrc" src="assets/images/head.png" class="layui-nav-img">
			<cite><span id="usernameZby"></span></cite>
		</a>
		<dl class="layui-nav-child">
			<dd lay-unselect>
				<a id="setInfo">个人信息</a>
			</dd>
			<dd lay-unselect>
				<a id="setPsw">修改密码</a>
			</dd>
			<hr>
			<dd lay-unselect>
				<a id="btnLogout">退出</a>
			</dd>
		</dl>
	</li>
	<!--<li class="layui-nav-item" lay-unselect>
        <a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
    </li>-->
</ul>
<script>
	layui.use(['config', 'admin'], function() {
		var config = layui.config,
			admin = layui.admin;
		var alog = config.getTempData('loginInfo');
		var a;

		if(alog.orgId == 1) {
			a = ""
		} else {
			a = "" + alog.orgId
		}
		$.ajax({
			type: "POST",
			url: infosUser,
			data: {
				userId: alog.userId,
				orgId: a
			},
			dataType: "json",
			xhrFields: {
				withCredentials: true
			},
			success: function(data) {
				if(data.rows.nicename != null) {
					$('#usernameZby').html(data.rows.nicename)
				} else {
					$('#usernameZby').html(data.rows.username)
				}

				if(data.rows.picUrl) {
					$("#asrc").attr("src", data.rows.picUrl);
				}
			},
			error: function(result) {
				config.removeToken();
				location.replace('login.html');
				console.log(result);
			},
		});
	})
</script>